﻿using System;
using System.Collections.Generic;

using Carbon.Web.Forms.jQueryForms;

namespace Demo.Demos.TravelRequest
{
    [Serializable]
    public class TravelViewModel
    {
        #region Properties (13)
        public String BusinessPurpose { get; set; }
        public String CarClass { get; set; }
        public DropDownListItemCollection<String, String> CarClassDropDown
        {
            get
            {
                DropDownListItemCollection<String, String> carClassDropDown = new DropDownListItemCollection<string, string>(TravelRequestData.CarClasses, i => i, i => i, this.CarClass, true);
                return carClassDropDown;
            }
            set
            {
                CarClass = value.SelectedItem;
            }
        }
        public String EmailAddress { get; set; }
        public bool NonSmokingHotelRoomRequired { get; set; }
        public String Notes { get; set; }
        public DateTime RequestDate { get; set; }
        public String SeatLocation { get; set; }
        public DropDownListItemCollection<String, String> SeatLocationDropDown
        {
            get
            {
                DropDownListItemCollection<String, String> seartLocationDropDown = new DropDownListItemCollection<string, string>(TravelRequestData.SeatLocations, i => i, i => i, this.SeatLocation, true);

                return seartLocationDropDown;
            }
            set
            {
                this.SeatLocation = value.SelectedItem;
            }
        }
        public String TravelerName { get; set; }
        public String TripClass { get; set; }
        public DropDownListItemCollection<String, String> TripClassDropDown
        {
            get
            {
                DropDownListItemCollection<String, String> tripClass = new DropDownListItemCollection<string, string>(TravelRequestData.TripClasses, i => i, i => i, this.TripClass, true);

                return tripClass;
            }
            set
            {
                this.TripClass = value.SelectedItem;
            }
        }
        public List<TripViewModel> Trips { get; set; }
        #endregion

        #region Constructors (1)
        public TravelViewModel()
        {
            Trips = new List<TripViewModel>();
            Trips.Add(new TripViewModel(this));
            this.RequestDate = DateTime.Now;
        }
        #endregion

        #region Methods (1)

        public void AddTrip()
        {
            this.Trips.Add(new TripViewModel(this));
        }

        #endregion
    }
}